package com.caoji.advice;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 * @Description： User: caoji
 * Date: 2020/12/3
 * Time: 20:54
 */
@ControllerAdvice
public class lyConteollor {
    @ExceptionHandler(lyExcption.class)
    public ResponseEntity<String> handlaer(lyExcption r){
        return ResponseEntity.status(r.getCode()).body(r.getMessage());
    }
}

